/*Pokemon Universe MMORPG
Copyright (C) 2010 the Pokemon Universe Authors

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.*/
package pubattle

import (
	pnet "network"
)

const (
	DYNAMICINFO_SPYKES byte = 1
	DYNAMICINFO_SPYKESL2 = 2
	DYNAMICINFO_SPYKESL3 = 4
	DYNAMICINFO_STEALTHROCK = 8
	DYNAMICINFO_TOXICSPYKES = 16
	DYNAMICINFO_TOXICSPYKESL2 = 32
)

type BattleDynamicInfo struct {
	Boosts []byte
	Flags byte
}

func NewBattleDynamicInfoFromPacket(_packet *pnet.QTPacket) *BattleDynamicInfo {
	battleDynamicInfo := BattleDynamicInfo{}
	battleDynamicInfo.Boosts = make([]byte, 7)
	for i := 0; i < 7; i++ {
		battleDynamicInfo.Boosts[i] = _packet.ReadUint8()
	}
	battleDynamicInfo.Flags = _packet.ReadUint8()
	
	return &battleDynamicInfo
}